/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.edu.upc.dew.sisrest.controller;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import pe.edu.upc.dew.sisrest.model.Local;
import pe.edu.upc.dew.sisrest.service.LocalManager;

/**
 *
 * @author Aldo
 */

@Controller
public class LocalController {

    LocalManager localManager;

    @Autowired
    public LocalController(LocalManager oLocalManager){
        this.localManager=oLocalManager;
    }

    @RequestMapping("/adm_locales.htm")
    public void adm_locales(Model model, @ModelAttribute("Local") Local local) {
		List<Local> locales = localManager.obtenerLocales();
                model.addAttribute("locales", locales);
                model.addAttribute("local", local);
    }

}
